package innerclass;

/**
 * @author ZhuQi
 * @ClassName PigBird
 * @Date 2022/11/11 15:42
 * @Version 1.0
 * @Description TODO
 */
public class PigBird extends PigBirdAbstract{

    private PigBirdFly pigBirdFly;


    public PigBird(PigBirdFly pigBirdFly) {
        this.pigBirdFly = pigBirdFly;
    }

    public PigBird(String name, PigBirdFly pigBirdFly) {
        this(pigBirdFly);
        setName(name);
        setType("陆行鸟");
    }

    @Override
    public String doFly() {
        return getName() + ":" + getType() + "-" + pigBirdFly.doFly();
    }

    @FunctionalInterface
    public interface PigBirdFly extends Fly{

        @Override
        String doFly();
    }
}
